<!-- 我的弹窗 -->

<template>
  <WebModal title="预警详情" noEdit small>
    <WebShow>
      <div>
        <MajorTitle title="预警信息">
          <ShowStatus bind="alarmResolveState" noLabel />
        </MajorTitle>

        <EasyRow col2>
          <ShowTime label="预警时间" bind="alarmTime" />
          <ShowText label="预警类型" bind="alarmTypeName" />
        </EasyRow>

        <EasyRow col2>
          <ShowText label="预警人员" bind="name" />
          <ShowText label="联系方式" bind="phone" />
        </EasyRow>

        <ShowText label="证件号码" bind="credentialNumber" />

        <ShowText label="最近记录" bind="recordMsg" :minWidth="200" multiRow />
      </div>

      <MajorTitle title="处理结果" />

      <WebForm v-if="one.alarmResolveState === 1">
        <FormSelect label="处理方式" bind="operate" :dict="DICT.OPERATE" half @change="changeOperate" />
        <FormTextarea label="操作信息" bind="dealDesc" :max="100" />
      </WebForm>

      <div v-else>
        <ShowDict label="处理方式" bind="alarmResolveState" :dict="DICT.OPERATE" />
        <ShowText label="操作信息" bind="dealDesc" multiRow />
      </div>
    </WebShow>
  </WebModal>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyModal',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 切换处理方式
     */
    changeOperate(operate) {
      const { MAP, DICT } = this
      MAP.tipEdit = CORE.dict(DICT.OPERATE, operate)
    },
  },
}
</script>
